package demo.service;

import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import demo.bo.StudentMax;
import demo.bo.Teacher;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Example;
import io.swagger.annotations.ExampleProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.ResponseHeader;


@Api(	//标记在接口,类,枚举上，表明是swagger资源
		value="Api上的value",	
		tags={"api分组1","api分组2"},
		consumes="application/json, application/xml",	//支持接收的参数格式
		produces="application/json, application/xml",	//返回值的格式
		protocols="http,https",	//支持的协议
		authorizations={@Authorization(
				value = "",
				scopes={@AuthorizationScope(description = "", scope = "")}
			)}
		//hidden=false	//该类下的swagger注解是否会被识别
)
public class PlainServiceMax {
	
	@ApiOperation(
			value = "方法的概括说明，<120字：fun36",
			notes="很长很长的方法注释：fun36",
			tags={"ApiOperation分组1","ApiOperation标签2"},
			response=StudentMax.class,	//手动指定返回值
			responseContainer="List",	//返回值的容器：必须是"List", "Set" or "Map". 
			responseReference="返回值的相关说明",	//返回值的相关说明
			/*使用哪个http方法，可选值："GET"获取资源, "HEAD","DELETE"删除资源, "OPTIONS"获取配置
			 * "POST"新建资源, "PUT"更新资源, "PATCH"局部更新资源*/
			httpMethod="GET",	
			consumes="application/json, application/xml",	//支持接收的参数格式
			produces="application/json, application/xml",	//返回值的格式
			protocols="http,http2",	//支持的协议
			authorizations={@Authorization(value = "")},
			responseHeaders={@ResponseHeader()},
			code=200,	//返回的http状态码
			extensions=@Extension(	//扩展
					name="x-扩展",
					properties = @ExtensionProperty(name = "name1", value = "value1")
				)
		)
	@ApiImplicitParams(value={	//或微调参数配置@ApiParam
			@ApiImplicitParam(
						name="count",	//参数名
						value="参数的注释-count",
						defaultValue="参数默认值",
						allowableValues="1,2,3",	//参数的取值范围，格式：枚举用逗号，数值范围用range[2,5),[1,infinity]
						required=true,	//该参数是否必填
						dataType="int",	//数据类型：类名或基本类型
						paramType="form",	//参数类型： path, query, body, header or form
						example="参数值示例"		//作用于非body类型的参数
					)})
	@ApiResponses(value={	//返回说明
				@ApiResponse(
						code=200,	//返回的http状态码
						message="返回说明",
						response=StudentMax.class,	//手动指定返回值
						responseContainer="List",	//返回值的容器：必须是"List", "Set" or "Map". 
						reference="返回值的相关说明",	//返回值的相关说明
						responseHeaders={@ResponseHeader(
								name="@ResponseHeader的名称",
								description="@ResponseHeader的描述",
								response=StudentMax.class,	//手动指定返回值
								responseContainer="Set"	//返回值的容器：必须是"List", "Set" . 
							)}
					)	
			})
	@RequestMapping(value="/test/one",method=RequestMethod.POST)
	public Teacher fun36(@ApiParam(
				value="实体类Teacher参数注释说明",
				examples=@Example(	//作用于body类型的参数
						value = @ExampleProperty(mediaType = "参数名key", value = "参数值value"))
				)Teacher t,@ApiParam(
						name="count",	//参数名
						value="参数的注释-count",
						defaultValue="参数默认值",
						allowableValues="1,2,3",	//参数的取值范围，格式：枚举用逗号，数值范围用range[2,5),[1,infinity]
						required=true,	//该参数是否必填
						example="参数值示例"		//作用于非body类型的参数
					)int count,@ApiParam StudentMax ss){return null;}
	
	public void fun00(){}
	
	public int fun10(){return 0;}
	
	public Map<String,String> fun20(){return null;}
	
	public Teacher fun30(){return null;}
	
	public Object fun40(){return null;}
	
	public void fun01(int num){}
	
	public void fun02(Map<String,String> map){}
	
	public void fun03(Teacher t){}
	
	public void fun04(Object obj){}
	
	public void fun05(Teacher t,int count){}
	
	public Teacher fun35(Teacher t,int count){return null;}
}

